package cn.amossun.starter.web.data.security.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @program: starter-parent
 * @description:
 * @author: Amos.Sun
 * @DateTime: 2020/03/28 19:51
 **/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Result<T> {

    private int code = 200;

    private boolean success = true;

    private T data;

    private String msg;

    public Result(boolean success){
        this.success = success;
    }

    public Result(T data){
        this.data = data;
    }

    public Result(T data, boolean success){
        this.data = data;
        this.success = success;
    }

    public Result(int code, boolean success, T data){
        this.code = code;
        this.success = success;
        this.data = data;
    }

}
